Optimal. Leaf size=79 \[ -\frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{\log (\cos (c+d x))}{a^2 d}-\frac{3 i x}{4 a^2}-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.140027, antiderivative size = 79, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3558, 3589, 3475, 12, 3526, 8} \[ -\frac{3}{4 a^2 d (1+i \tan (c+d x))}+\frac{\log (\cos (c+d x))}{a^2 d}-\frac{3 i x}{4 a^2}-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3558
Rule 3589
Rule 3475
Rule 12
Rule 3526
Rule 8
Rubi steps
\begin{align*} \int \frac{\tan ^3(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2}-\frac{\int \frac{\tan (c+d x) (-2 a+4 i a \tan (c+d x))}{a+i a \tan (c+d x)} \, dx}{4 a^2}\\ &=-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2}+\frac{i \int -\frac{6 i a^2 \tan (c+d x)}{a+i a \tan (c+d x)} \, dx}{4 a^3}-\frac{\int \tan (c+d x) \, dx}{a^2}\\ &=\frac{\log (\cos (c+d x))}{a^2 d}-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2}+\frac{3 \int \frac{\tan (c+d x)}{a+i a \tan (c+d x)} \, dx}{2 a}\\ &=\frac{\log (\cos (c+d x))}{a^2 d}-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2}-\frac{3}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}-\frac{(3 i) \int 1 \, dx}{4 a^2}\\ &=-\frac{3 i x}{4 a^2}+\frac{\log (\cos (c+d x))}{a^2 d}-\frac{\tan ^2(c+d x)}{4 d (a+i a \tan (c+d x))^2}-\frac{3}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end{align*}
Mathematica [A] time = 0.344092, size = 135, normalized size = 1.71 \[ \frac{\sec ^2(c+d x) \left (4 d x \sin (2 (c+d x))+i \sin (2 (c+d x))+\cos (2 (c+d x)) \left (-8 \log \left (\cos ^2(c+d x)\right )-4 i d x-1\right )-8 i \sin (2 (c+d x)) \log \left (\cos ^2(c+d x)\right )+16 i \tan ^{-1}(\tan (d x)) (\cos (2 (c+d x))+i \sin (2 (c+d x)))+8\right )}{16 a^2 d (\tan (c+d x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.023, size = 77, normalized size = 1. \begin{align*}{\frac{{\frac{5\,i}{4}}}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{1}{4\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{7\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{8\,{a}^{2}d}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{8\,{a}^{2}d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.19746, size = 201, normalized size = 2.54 \begin{align*} \frac{{\left (-28 i \, d x e^{\left (4 i \, d x + 4 i \, c\right )} + 16 \, e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{16 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.9938, size = 150, normalized size = 1.9 \begin{align*} \begin{cases} \frac{\left (- 16 a^{2} d e^{4 i c} e^{- 2 i d x} + 2 a^{2} d e^{2 i c} e^{- 4 i d x}\right ) e^{- 6 i c}}{32 a^{4} d^{2}} & \text{for}\: 32 a^{4} d^{2} e^{6 i c} \neq 0 \\x \left (- \frac{\left (7 i e^{4 i c} - 4 i e^{2 i c} + i\right ) e^{- 4 i c}}{4 a^{2}} + \frac{7 i}{4 a^{2}}\right ) & \text{otherwise} \end{cases} - \frac{7 i x}{4 a^{2}} + \frac{\log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.86398, size = 93, normalized size = 1.18 \begin{align*} -\frac{\frac{2 \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} + \frac{14 \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac{21 \, \tan \left (d x + c\right )^{2} - 22 i \, \tan \left (d x + c\right ) - 5}{a^{2}{\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]